package kgame5.k3d.comp {
import flash.events.MouseEvent;

/**
 * @author kk
 * 鼠标放上去就自动转
 */
public class Obj3DViewerRotating extends Obj3DViewer{
	private var bRotating:Boolean=false;
	public function Obj3DViewerRotating(w:int,h:int,bShowAxis:Boolean=true){
		super(w,h);
		
		
		this.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
		this.addEventListener(MouseEvent.ROLL_OUT, onMouseLeave);
	}
	
	//执行单次更新
	override public function update(){
		super.update();
		if(this.bRotating){
			this.right(10);
		}
	}
	
	private function onMouseOver(e:MouseEvent){
		this.bRotating=true;
	}

	private function onMouseLeave(e:MouseEvent){
		this.bRotating=false;
	}
}
}
